<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="user">
        姓名 <p>：tom</p>
        <p>年龄：12</p>
        <p>性别：男</p>
    </div>
</body>
<script>
    //http://localhost:8080/user   查询所有用户
    var obj = {
        name:'tomk',
        age:12
    }

    var p = document.getElementsByTagName('p')

    p[0].innerText = obj.name
    p[1].innerText = obj.age

</script>
</html>